home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / eKH.txt < prev    next >
Encoding:
Text File  |  2000-01-24  |  3.8 KB  |  134 lines

  1.     Tutorial eKH CrackMe 1.0
  2.     
  3.               By
  4.               
  5.           Sanhedrin
  6.           
  7. Date:  13 March 1999
  8. Email: Stachi@geocities.com
  9. Tools: Softice 3.24
  10.  
  11.  
  12. This crackme asks the user to supply their name and serial.  An error message 
  13. 'Wrong Serial Number!' is given if the number is incorrect.
  14.  
  15. I always start cracking using hmemcpy.  This gets me into the code 95% of the 
  16. time, and enables me to see right away what kind of code I am looking at 
  17. (ie. VB or C, or some other).
  18.  
  19. So....
  20.  
  21. Enter your name and serial number:
  22.  
  23. I used.... Sanhedrin
  24.            12344321
  25.  
  26. go into softice and enter the breakpoint
  27.  
  28. bpx hmemcpy
  29.  
  30. exit softice and press on OK
  31.  
  32. This will break into softice.  Disable the breakpoint by typing bd * .  
  33. Press F12 several times (it took me 12 times), until you reach the code:
  34.  
  35. :00427B65 E826E2FEFF              call 00415D90
  36. :00427B6A 8B45FC                  mov eax, dword ptr [ebp-04]<------you will end up here;
  37. :00427B6D E83EBCFDFF              call 004037B0
  38. :00427B72 48                      dec eax
  39. :00427B73 7C30                    jl 00427BA5
  40. :00427B75 8D55FC                  lea edx, dword ptr [ebp-04]
  41. :00427B78 8B83EC010000            mov eax, dword ptr [ebx+000001EC]
  42.  
  43. CALL 00415D90
  44.  
  45. Press F10 once, then type
  46.  
  47. d eax
  48.  
  49. You should see your name in the data window.
  50.  
  51. Press F10 several more times until you are at
  52.  
  53.  
  54. :00427B7E E80DE2FEFF              call 00415D90
  55. :00427B83 8B45FC                  mov eax, dword ptr [ebp-04]
  56. :00427B86 50                      push eax
  57. :00427B87 8D55F8                  lea edx, dword ptr [ebp-08]
  58. :00427B8A 8B83DC010000            mov eax, dword ptr [ebx+000001DC]
  59. :00427B90 E8FBE1FEFF              call 00415D90
  60. :00427B95 8B45F8                  mov eax, dword ptr [ebp-08]
  61. :00427B98 5A                      pop edx
  62. :00427B99 E882FEFFFF              call 00427A20
  63. :00427B9E 3D4E61BC00              cmp eax, 00BC614E<-----stop here
  64. :00427BA3 7D1E                    jge 00427BC3
  65.  
  66. POP EDX
  67.  
  68. At this point type 
  69.  
  70. d edx
  71.  
  72. In the data window you should see:
  73.  
  74. A. Your name;
  75. B. Your entered serial number; and
  76. C. The actual serial number.
  77.  
  78. In my case
  79.  
  80. A. Sanhedrin
  81. B. 12344321
  82. C. 4NNN54YN5A
  83.  
  84.  
  85. So what happened?
  86.  
  87. If you delve a little more into the code, and put a break point on the call at
  88.  
  89. 00427A20 (type bpx 00427A20),
  90.  
  91. you will notice that your name is checked, changed into a code, then compared at:
  92.  
  93.  
  94. :00427ABE 8BC3                    mov eax, ebx
  95. :00427AC0 B90A000000              mov ecx, 0000000A
  96. :00427AC5 99                      cdq
  97. :00427AC6 F7F9                    idiv ecx
  98. :00427AC8 62153C7B4200            bound edx, dword ptr [00427B3C]
  99. :00427ACE 8A9284884200            mov dl, byte ptr [edx+00428884]
  100. :00427AD4 8D45F0                  lea eax, dword ptr [ebp-10]
  101. :00427AD7 E8FCBBFDFF              call 004036D8
  102. :00427ADC 8B55F0                  mov edx, dword ptr [ebp-10]
  103. :00427ADF 8D45F4                  lea eax, dword ptr [ebp-0C]
  104. :00427AE2 E8D1BCFDFF              call 004037B8
  105. :00427AE7 8BC3                    mov eax, ebx
  106. :00427AE9 B90A000000              mov ecx, 0000000A
  107. :00427AEE 99                      cdq
  108. :00427AEF F7F9                    idiv ecx
  109. :00427AF1 8BD8                    mov ebx, eax
  110. :00427AF3 4E                      dec esi
  111. :00427AF4 75C8                    jne 00427ABE
  112. :00427ABE 8BC3
  113.  
  114.  
  115. If you do a memory dump at:
  116.  
  117. 00B96368 (d 00B96368)
  118.  
  119. and watch the data window, you will see the actual code appear before your eyes.
  120.  
  121.  
  122.  
  123. Notes
  124.  
  125. This is my first public tutorial, and I am far from an expert. If I have made any errors, 
  126. or have not explained myself clearly, email me at the address above.  
  127.  
  128.  
  129. My thanks go to all of the people who make these CrackMes, and to
  130. The Sandman for taking the time to set up a web page encouraging all of us to
  131. better our skills.
  132.  
  133. Sanhedrin
  134.